package top.sdwu_top.kbase.config;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.web.servlet.WebMvcRegistrations;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.annotation.Order;
import org.springframework.web.method.support.HandlerMethodArgumentResolver;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping;
import top.sdwu_top.kbase.common.interceptor.CurrentUserResolver;

import java.util.List;

/**
 * @author Created by zhangbowen on 2017/5/5.
 */
@Configuration
@Order(1)
public class WebMvcConfiguration implements WebMvcConfigurer {


    @Autowired
    private CurrentUserResolver currentUserResolver;



    @Override
    public void addInterceptors(InterceptorRegistry registry) {

    }

    @Override
    public void addArgumentResolvers(List<HandlerMethodArgumentResolver> argumentResolvers) {
        argumentResolvers.add(currentUserResolver);
    }



}
